<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>SweetAlert2 本地示例</title>
<link rel="stylesheet" href="sweetalert2.css">
<script src="sweetalert2.js"></script>
<script>
function successBtn() {
    Swal.fire({
        title: '操作成功！',
        text: '数据已保存。',
        icon: 'success',
        confirmButtonText: '确定',
        allowOutsideClick: false, // 禁止点击遮罩层关闭弹窗
        allowEscapeKey: false,  // 其他可选增强：禁用按 Esc 关闭（可选）
      });
  }
</script>
</head>
<body>
<button onclick="successBtn()">成功提示</button>
</body>
</html>